#pragma once

#include "NxPhysics.h"

#include <ace/ACE.h>
#include <ace/Thread.h>
#include <ace/Mutex.h>
#include <ace/Task.h>
#include <ace/OS.h>

namespace Physics
{
	// special vector using 64bit integers for max precision
	typedef struct 
	{   
		long long x,y,z;  
	}	Vect3LL;
	
	class PhysicsLocale
	{

	private:
		NxActor* CreateActorFromDesc(const NxShapeDesc& shapeDesc, const NxMat34& globalPose, bool body);
		ACE_Recursive_Thread_Mutex m_mutex;

	public:
		Vect3LL m_origin;

		NxScene* m_scene;
		long long m_localeid;

		PhysicsLocale(void);
		~PhysicsLocale(void);

		void addObject(long long p_objectid, NxVec3 &p_position);
		void removeObject(long long p_objectid);

		void update(float p_time);

	};
};